/* 竞赛获奖信息统计(新增部分) */
<template>
    <div>
        <div style="height: 30px;">
            <el-breadcrumb style="float: left;" separator="/">
                <el-breadcrumb-item :to="{ path: '/competiInformaStatistics' }">
                    <span @click="reback">{{ $t('statisticsOfAwards.statisticsAwards') }}</span>
                </el-breadcrumb-item>
                <el-breadcrumb-item>{{ $t('statisticsOfAwards.add') }}</el-breadcrumb-item>
            </el-breadcrumb>
        </div>

        <el-card v-loading="loading" shadow="never" body-style="padding: 10px;">
            <el-row style="padding:15px 15px 0 15px;" class="row-bg" justify="space-between">
                <span style="font-size:20px; color:#101010;">
                    {{ $t('statisticsOfAwards.manualAdd') }}
                </span>
                <el-button style="float:right; margin-left:10px;" @click="reback">
                    {{ $t('statisticsOfAwards.goBack') }}
                </el-button>
            </el-row>
            <hr >
            <el-form
                ref="queryForm"
                :model="queryForm"
                :rules="rules"
                label-suffix="："
                label-position="top"
            >
                <el-card shadow="never" body-style="padding: 24px;" style="margin: 0;border: none;">
                    <el-row :gutter="24">
                        <!-- 竞赛项目名称 -->
                        <el-col :span="12">
                            <el-form-item :label="$t('statisticsOfAwards.competitionName')" prop="projectName">
                                <el-input
                                    maxlength="100"
                                    v-model="queryForm.projectName"
                                    :placeholder="$t('statisticsOfAwards.pleaseEnter')"
                                    clearable
                                    style="width: 100%"
                                >
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <!-- 组织机构 -->
                        <el-col :span="12">
                            <el-form-item :label="$t('statisticsOfAwards.organStructure')" prop="orgName">
                                <el-input
                                    maxlength="100"
                                    v-model="queryForm.orgName"
                                    :placeholder="$t('statisticsOfAwards.pleaseEnter')"
                                    clearable
                                    style="width: 100%"
                                >
                                </el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row :gutter="24">
                        <!-- 竞赛级别 -->
                        <el-col :span="6">
                            <el-form-item :label="$t('statisticsOfAwards.competitionLevel')" prop="comLevel">
                                <el-select v-model="queryForm.comLevel" clearable style="width: 100%">
                                    <el-option
                                        v-for="item in options.batch"
                                        :key="item.id"
                                        :label="item.label"
                                        :value="item.label"
                                    >
                                    </el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <!-- 获奖时间 -->
                        <el-col :span="6">
                            <el-form-item :label="$t('statisticsOfAwards.awardTime')" prop="awardsDate">
                                <el-date-picker 
                                :picker-options="pickerOptionsStart"
                                type="month" 
                                :placeholder="$t('请选择')"
                                v-model="queryForm.awardsDate"
                                value-format="yyyy-MM"
                                style="width: 100%;"></el-date-picker>
                            </el-form-item>
                        </el-col>
                         <!-- 参赛形式 -->
                        <el-col :span="6">
                            <el-form-item :label="$t('statisticsOfAwards.entryForm')" prop="comForm">
                                <el-select v-model="queryForm.comForm" @change="getComForm" clearable style="width: 100%;">
                                    <el-option
                                        v-for="item in options.match"
                                        :key="item.id"
                                        :label="item.label"
                                        :value="item.label"
                                    >
                                    </el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <!-- 学院 -->
                        <el-col :span="6">
                            <el-form-item :label="$t('label.college')" prop="college">
                                <!-- <DictSelect v-model="queryForm.departmentId" :data="options.departmentId" :clearable="true" ></DictSelect> -->
                                <DictSelect :labelAll="$t('statisticsOfAwards.whole')" v-model="queryForm.college" filterable :data="options.departmentId" :clearable="true" @change="getCollegeName(queryForm.college)" ></DictSelect>
                            </el-form-item>
                        </el-col>
                        <!-- 是否立项 -->
                        <el-col :span="6">
                            <el-form-item :label="$t('statisticsOfAwards.projectApprovalOrNot')">
                                <el-select
                                    v-model="queryForm.projectId"
                                    clearable
                                    style="width: 100%">
                                    <el-option
                                        v-for="item in projectId"
                                        :key="item.id"
                                        :label="item.label"
                                        :value="item.value">
                                    </el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                    </el-row>
                </el-card>
                
            </el-form>
            <el-form  
                :model="dynamicValidateForm"
                ref="dynamicValidateForm"
                label-suffix="："
                label-position="top">
                <div style="padding: 15px;height: 70px;line-height: 35px;">
                    <h2 style="float:left;color:#101010">{{ $t('statisticsOfAwards.tournamentScore') }}</h2>
                    <el-button type="primary" style="float:left; margin:2px 0 0 10px;" @click="addClick">
                        {{ $t('statisticsOfAwards.addTeam') }}
                    </el-button>
                    <!-- <el-button type="primary" style="float:left; margin-left:10px;" @click="batchImport">
                        {{ $t('批量导入') }}
                    </el-button> -->
                    <el-dropdown placement='bottom-start' trigger="click" @command="downloadFile">
                        <el-button type="primary">{{$t('statisticsOfAwards.batchImport')}}<i class="el-icon-arrow-down el-icon--right"></i></el-button>
                        <el-dropdown-menu slot="dropdown">
                        <el-dropdown-item command="importData">{{$t('statisticsOfAwards.importData')}}</el-dropdown-item>
                        <el-dropdown-item command="download">{{$t('internship.download')}}</el-dropdown-item>
                        </el-dropdown-menu>
                    </el-dropdown>
                </div>
                <el-row style="padding:15px;" :gutter="24" v-for="(domain, index) in dynamicValidateForm.domains"
                   
                    :key="domain.key"
                    :prop="'domains.' + index + '.value'">
                    <!-- 组织机构 -->
                    <el-col :span="6">
                        <el-form-item 
                            :label="$t('statisticsOfAwards.awardLevel')" 
                            :prop='"domains." + index +"awardsName"' >
                            <el-select v-model="domain.awardsName" @change="otherAwardClick(domain.awardsName, index, domain)" clearable style="width: 100%">
                                <el-option
                                    v-for="item in options.prize"
                                    :key="item.id"
                                    :label="item.label"
                                    :value="item.value"
                                >
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="4">
                        <el-form-item v-if="domain.awardsCode === '99'" :label="$t('projectDeclara.awardName')" :prop='"domains." + index +"otherAward"'>
                            <el-input
                                maxlength="100"
                                v-model="domain.otherAward"
                                :placeholder="$t('statisticsOfAwards.pleaseEnter')"
                                clearable
                                style="width: 100%"
                            >
                            </el-input>
                        </el-form-item>
                    </el-col>
                    <!-- 作品名称 -->
                    <el-col :span="14">
                        <el-form-item 
                            :label="$t('statisticsOfAwards.titleOfTheWork')" 
                            :prop='"domains." + index +"projectTitle"'>
                            <el-input
                                maxlength="100"
                                v-model="domain.projectTitle"
                                :placeholder="$t('statisticsOfAwards.pleaseEnter')"
                                clearable
                                style="width: 80%"
                            >
                            </el-input>
                        </el-form-item>
                    </el-col>
                    <!-- 指导老师 -->
                    <el-col :span="6">
                        <el-form-item :label="$t('statisticsOfAwards.instructor')" :prop='"domains." + index +"instructor"'>
                            <el-input
                                maxlength="100"
                                v-model="domain.instructor"
                                :placeholder="$t('statisticsOfAwards.pleaseEnter')"
                                clearable
                                style="width: 100%"
                            >
                            </el-input>
                        </el-form-item>
                    </el-col>
                    <edu-table
                        :pagination="false"
                        :selection="false"
                        :tooltip-effect="tooltipEffect"
                        :data="domain.studentList"
                        stripe
                        size="mini"
                    >
                        <edu-table-column align='center' :label="$t('statisticsOfAwards.name')" prop="studentId">
                            <template slot-scope="scope">
                                <template v-if="!scope.row.flag">
                                    <el-select
                                        :placeholder="$t('statisticsOfAwards.pleaseInputNumber')"
                                        v-model="scope.row.studentName"
                                        :remote-method="remoteMethodTow"
                                        style="width: 100%"
                                        clearable
                                        filterable
                                        remote
                                        reserve-keyword
                                        @change="changeInput"
                                    >
                                        <el-option
                                            v-for="item in options.name"
                                            :key="item.studentId"
                                            @click.native="queryNameClick(item.studentId, scope.row, 'studentId')"
                                            :label="item.studentName"
                                            :value="item.studentId"
                                        >
                                        </el-option>
                                    </el-select>
                                    <!-- <el-input v-if="!scope.row.flag"
                                        :placeholder="$t('statisticsOfAwards.name')"
                                        v-model.trim="scope.row.studentName"
                                        clearable
                                        maxlength="64"
                                    >
                                    </el-input> -->
                                </template>
                                <span v-else>{{ scope.row.studentName }}</span>
                            </template>
                        </edu-table-column>
                        <edu-table-column align='center' :label="$t('statisticsOfAwards.studentId')" prop="awardsCode">
                            <template slot-scope="scope">
                                <el-input v-if="!scope.row.flag"
                                    :placeholder="$t('statisticsOfAwards.pleaseInputNumber')"
                                    v-model.trim="scope.row.studentId"
                                    clearable
                                    maxlength="64"
                                >
                                </el-input>
                                <span v-else>{{ scope.row.studentId }}</span>
                            </template>
                        </edu-table-column>
                        <edu-table-column :label="$t('statisticsOfAwards.operation')" fit prop="operate">
                            <template slot-scope="props">
                                <el-button v-if="!props.row.flag" type="text"  @click="saves(props.row, props.$index, domain)"> {{ $t('statisticsOfAwards.save') }}</el-button>
                                <el-button v-if="props.row.flag"  type="text"  @click="editInternEval(props.row, props.$index)"> {{ $t('statisticsOfAwards.edit') }}</el-button>
                                <el-button v-if="props.row.flag"  type="text"  @click="deletes(props.row, props.$index, domain)"> {{ $t('statisticsOfAwards.delete') }}</el-button>
                            </template>
                        </edu-table-column>
                    </edu-table>
                </el-row>
            </el-form>
            <div style="float: right; padding: 15px;">
                <el-button @click="cancel">{{ $t('statisticsOfAwards.cancel') }}</el-button>
                <el-button type="primary" @click="saves2"> {{ $t('statisticsOfAwards.save') }}</el-button>
            </div>
        </el-card>
        <!--批量导入弹窗-->
        <el-dialog
            :title.sync="batchImportDialog.dialogTitle"
            :visible.sync="batchImportDialog.showDialog"
            width="30%"
        >
            <el-upload
                action="/api/competitionservice/manage/manageprojectawardsinfo/awardInfo/import"
                class="upload-demo"
                ref="upload"
                :file-list="batchImportDialog.uploadConfig.fileList"
                :data='dataObj'
                :on-success="handlerSuccess"
                :on-error="handlerError"
                :before-upload="beforeUpload"
                accept="xlsx"
                :auto-upload="true"
                :show-file-list="false"
            >
                <el-button slot="trigger" size="small" type="primary" style="margin-left:200px">{{ $t('statisticsOfAwards.selectFile') }}</el-button>
                <div style="margin-left:28%;margin-top:10px">{{$t('conOfIntAcaCon.uploadNotice')}}</div>
            </el-upload>
             <el-table stripe :data="errList" size="mini" v-show="ifErr" tooltip-effect="light">
                <el-table-column
                    :label="$t('projectDeclara.awardName')"
                    prop="awardsName"
                    show-overflow-tooltip
                ></el-table-column>
                <el-table-column
                    :label="$t('statisticsOfAwards.titleOfTheWork')"
                    prop="projectTitle"
                    show-overflow-tooltip
                ></el-table-column>
                <el-table-column
                    :label="$t('performanceManagement.studentName')"
                    prop="studentName"
                    show-overflow-tooltip
                ></el-table-column>
                <el-table-column
                    :label="$t('performanceManagement.studentId')" 
                    prop="studentId"
                    show-overflow-tooltip
                ></el-table-column>
                <!-- 原因 -->
                <el-table-column
                    :label="$t('performanceManagement.reasonsForFailure')"
                    prop="errorMsg"
                    show-overflow-tooltip
                ></el-table-column>
            </el-table>
            <span slot="footer" class="dialog-footer">
                <el-button @click="batchImportDialog.showDialog = false">{{ $t('statisticsOfAwards.close') }}</el-button>
            </span>
        </el-dialog>
    </div>
</template>

<script>
import { queryDic } from 'common/src/api/dictionary'
import UTILS from 'common/src/utils/utils'
import competiManagementApi from 'common/src/api/subjectCompetition/competiManagement'
import interManagementApi from 'common/src/api/externalExchange/interdiSciplinaryManagement'

import { findTeacherInfoList } from 'common/src/api/studentinfo'
export default {
    props: {
        compile: {
            type: String,
            default: ''
        }
    },
    data() {
        let cannotEnter = (rule, value, callback) => {
            let reg = /[`$]/im
            if (reg.test(value)) {
                return callback(new Error(this.$t('statisticsOfAwards.donotEnterSpecial')))
            } else if (value === '' || value === null) {
                return callback(new Error(this.$t('statisticsOfAwards.pleaseEnter')))
            }
            return callback()
        }
        return {
            dynamicValidateForm: {
                domains: [
                    { 
                        instructor: "",
                        awardsName: '',
                        otherAward: '',
                        awardsCode: '',
                        projectTitle: "",
                        studentList:[{

                        }] 
                    }
                ],
            },
            queryForm: {
                projectName: '', // 竞赛项目名称
                projectTitle: '', // 作品名称
                comLevel: '', // 竞赛级别
                orgName: '', // 组织机构
                comForm: '', // 参赛形式
                college: '', // 学院
                collegeName: '',// 学院名称
                awardsDate: null, // 获奖时间
                awardsDateEnd: '',
                projectId: null // 是否立项
            },
            options: {
                batch: [], // 竞赛级别
                match: [], // 参赛形式
                // time: [], // 获奖时间
                prize: [], // 奖项名称
                name: [], // 姓名
                departmentId: [] // 学院
            },
            dataObj: {
                comForm: ''
            },
            batchImportDialog: {
                dialogTitle: "批量上传",
                showDialog: false,
                uploadConfig: {
                    fileList: [],
                    handlerChange(file, fileList) {
                        this.fileList = fileList.slice(-1);
                    },
                    handlerExceed(file, fileList) {
                        this.fileList = fileList.slice(-1);
                    }
                }
            },
            pickerOptionsStart: {
                disabledDate: time => {
                let endDateVal = this.queryForm.awardsDateEnd;
                if (endDateVal) {
                    // return time.getTime() > endDateVal;
                    return time.getTime() >= new Date(endDateVal).getTime();
                }
                }
            },
            errList: [],
            ifErr: false, // 是否展示错误信息
            rules: {
                projectName: [
                    {
                        required: true,
                        message: this.$t('statisticsOfAwards.pleaseSelectCompet'),
                        trigger: 'blur'
                    },
                    { validator: cannotEnter, trigger: 'blur' }
                ],
                projectTitle: [
                    {
                        required: true,
                        message: this.$t('statisticsOfAwards.pleaseSelectOpus'),
                        trigger: 'blur'
                    },
                    { validator: cannotEnter, trigger: 'blur' }
                ],
                comLevel: [
                    {
                        required: true,
                        message: this.$t('statisticsOfAwards.pleaseSelectLevel'),
                        trigger: 'change'
                    }
                ],
                orgName: [
                    {
                        required: true,
                        message: this.$t('statisticsOfAwards.pleaseSelectOrgan'),
                        trigger: 'blur'
                    },
                    { validator: cannotEnter, trigger: 'blur' }
                ],
                comForm: [
                    {
                        required: true,
                        message: this.$t('statisticsOfAwards.pleaseSelectForm'),
                        trigger: 'change'
                    }
                ],
                awardsDate: [
                    {
                        required: true,
                        message: this.$t('statisticsOfAwards.pleaseSelectTime'),
                        trigger: 'change'
                    },
                ],
                college: [
                    {
                        required: true,
                        message: this.$t('projectInformationStatistics.college'),
                        trigger: 'change'
                    },
                ]
            },
            projectId: [
                {
                    value: null,
                    label: '否'
                }, {
                    value: -1,
                    label: '是'
                }
            ],
        }
    },
    mounted() {
        this.getOptions()
    },
    methods: {
        addClick() {
            let domainsLength = this.dynamicValidateForm.domains.length - 1
            if (this.dynamicValidateForm.domains[domainsLength].awardsName && this.dynamicValidateForm.domains[domainsLength].projectTitle) {
                this.dynamicValidateForm.domains.push(
                    { 
                        instructor: "",
                        awardsName: '',
                        otherAward: '',
                        awardsCode: '',
                        projectTitle: '',
                        studentList:[{
                            
                        }]
                    }
                )
            } else {
                this.$message({
                    type: 'warning',
                    message: this.$t('statisticsOfAwards.complete') // 请完成比赛成绩
                })
            }
            
        },
        changeAwardName(data, att) {
            this.$set(data, 'names', '')
            this.$set(data, 'code', att)
        },
        queryNameClick(name, row, str) {
            this.$set(row, str, name)
            this.options.name.forEach(el => {
                if (name === el.studentId) {
                    this.$set(row, 'studentName', el.studentName)
                }
            })
        },
        reback() {
            this.$emit('change-exam')
        },
        //上传文件类型校验
        beforeUpload(file) {
            return UTILS.checkFile(
                file,
                {
                    name: '.xlsx,.xls',
                    size: '5'
                },
                this
            )
        },
        handlerSuccess(response, file, fileList) {
            let responseCode = response.code
            if (responseCode === 200) {
                response.data.forEach((item) => {
                    item.studentList.forEach( value => {
                        value.flag = true
                    })
                    item.studentList.push({
                        "studentId": '',
                        "studentName": '',
                        "flag": false,
                    })
                })
                this.dynamicValidateForm.domains = response.data
                this.$message({
                    message: this.$t('statisticsOfAwards.uploadSuccessful'),
                    type: "success"
                });
                // this.onSubmit();
                this.batchImportDialog.uploadConfig.fileList = []
                this.batchImportDialog.showDialog = false
            } else {
                this.batchImportDialog.uploadConfig.fileList = []
                if (response.data) {
                    this.errList = response.data
                    this.ifErr = true
                    this.$message({type: "info", message: this.$t('statisticsOfAwards.addedFully')})
                } else {
                    this.$message({type: "info", message: response.msg})
                }
            }
        },
        handlerError(rresponse, file, fileList) {
            this.$message({
                message: this.$t('statisticsOfAwards.uploadFailed'),
                type: "error"
            });
            this.batchImportDialog.showDialog = false
        },
        batchImport() {
            this.$refs['queryForm'].validate(valid => {
                if (valid) {
                    this.batchImportDialog.showDialog = true
                }
            })
        },
        downloadFile(command) {
            if (command === 'importData') {
                this.$refs['queryForm'].validate(valid => {
                    if (valid) {
                        this.errList = []
                        this.ifErr = false
                        this.batchImportDialog.showDialog = true
                    }
                })
            } else if (command === 'download') {
                competiManagementApi.templateExport().then(res => {
                    this.batchImportDialog.showDialog = false
                    this.$message.success(this.$t('internship.successfully'))
                })
            }
        },
        // 学号改变获取数据
        remoteMethodTow(query) {
            if (query) {
                setTimeout(() => {
                    interManagementApi.getStudents(query).then(res => {
                        this.options.name = res.data
                    })
                }, 200)
            } else {
                this.options.name = []
            }
        },
        getComForm() {
            this.dataObj.comForm = this.queryForm.comForm === '团队' ? 1 : 2
        },
        // 学号改变获取数据
        changeInput(val) {
            if (val) {
                interManagementApi.getStudents(val).then(res => {
                    this.options.name = res.data
                })
            } else {
                this.options.name = []
            }
            if (this.options.name) {
                this.options.name.forEach(el => {
                    if (val === el.studentId) {
                        this.options.name.push(el)
                    }
                })
            }
        
        },
        getOptions() {
            // 筛选条件字典查询
            let data = {
                lang: this.$store.getters.language || 'cn',
                type: 'allChild',
                keys: ['X_YX', 'G_XBIE', 'JSGL_JSJB', 'G_GJQU', 'JSGL_CSXS', 'JSGL_JXMC']
            }
            queryDic(data).then(res => {
                UTILS.fillSelect(
                    {
                        batch: 'JSGL_JSJB',
                        sex: 'G_XBIE',
                        match: 'JSGL_CSXS',
                        prize: 'JSGL_JXMC',
                        departmentId: "X_YX"
                    },
                    res.data,
                    this.options
                )
            })
        },
        otherAwardClick(value, index, domain) {
            this.$set(domain,'awardsCode', value)
            this.options.prize.forEach((item) => {
                if (item.value === value) {
                    this.$set(domain,'awardsName', item.label)
                }
            })
            if (value !== '99') {
                this.$set(domain,'otherAward', '')
            }
        },
        // 获取学院名称
        getCollegeName(val) {
            this.options.departmentId.forEach((item) => {
                if (item.value === val) {
                    this.queryForm.collegeName = item.label
                }
            })
        },
        // 里面的编辑
        editInternEval(data, index) {
            this.$set(data,'flag', false)
            this.$set(data,'editFlag', true)
        },
        // 里面的删除
        deletes(data, index, domain) {
            this.$delConfirm()
                .then(() => {
                    domain.studentList.splice(index, 1)
                    // this.$message({
                    //     type: 'success',
                    //     message: this.$t('statisticsOfAwards.deletionSucceeded') 删除成功
                    // })
                })
                .catch(() => {
                    // this.$message({
                    //     type: 'info',
                    //     message: this.$t('statisticsOfAwards.deletionFailed')  删除失败
                    // })
                })
        },
        // 里面的保存
        saves(data, index, domain) {
            let isEqual = false
            for (let b = 0; b < domain.studentList.length - 1; b++) {
                for (let j = b + 1; j < domain.studentList.length; j++) {
                    // eslint-disable-next-line eqeqeq
                    if (domain.studentList[b].studentId === domain.studentList[j].studentId) {
                        isEqual = true
                        this.$message({
                            type: 'warning',
                            message: this.$t('statisticsOfAwards.studentNotEmpty') 
                        })
                        return
                    }
                }
            }
            if (data.studentId && data.studentName) {
                this.$set(data,'flag', true)
                // this.$set(data,'editFlag', false)
                if (!data.editFlag) {
                    domain.studentList.push({
                        studentName: '',
                        studentId: '',
                        flag: false,
                        index: index + 1,
                    })
                }
                this.$set(data,'editFlag', false)
            } else {
                this.$message({
                    type: 'warning',
                    message: this.$t('statisticsOfAwards.complete') // 请完成比赛成绩
                })
            }
        },
        // 外面的取消
        cancel() {
            this.$emit('change-exam')
        },
        // 外面的保存
        saves2() {
            this.$refs['queryForm'].validate(valid => {
                if (valid) {
                    let dynamicValidateForm = JSON.parse(JSON.stringify(this.dynamicValidateForm))
                    let isEqual = false
                    for (let b = 0; b < dynamicValidateForm.domains.length - 1; b++) {
                        for (let j = b + 1; j < dynamicValidateForm.domains.length; j++) {
                            // eslint-disable-next-line eqeqeq
                            if (dynamicValidateForm.domains[b].projectTitle === dynamicValidateForm.domains[j].projectTitle) {
                                this.$message.warning(this.$t('statisticsOfAwards.submitRepeatedly')) 
                                return
                            }
                        }
                    }
                    let studentAwardsInfoList = []
                    dynamicValidateForm.domains.forEach( item => {
                        if (!item.studentList[0].studentId && !item.studentList[0].studentName) {
                            isEqual = true
                        }
                        item.studentList.forEach( items => {
                            items.instructor = item.instructor
                            items.awardsCode = item.awardsCode
                            items.awardsName = item.otherAward ? item.otherAward : item.awardsName
                            items.projectTitle = item.projectTitle
                            if(items.studentName && items.studentId) {
                                studentAwardsInfoList.push(items)
                            }
                        })
                    })

                    for (const item of studentAwardsInfoList) {
                        if (isEqual || !item.awardsName) {
                            this.$message.warning(this.$t('statisticsOfAwards.notEmpty')) 
                            return
                        }
                    }
                    if(isEqual) {
                        return this.$message.warning(this.$t('statisticsOfAwards.studentNotEmpty'))
                    }
                    let param = {
                        "projectName": this.queryForm.projectName,
                        "comLevel": this.queryForm.comLevel,
                        "orgName": this.queryForm.orgName,
                        "awardsDate": this.queryForm.awardsDate,
                        "comForm": this.queryForm.comForm,
                        "college": this.queryForm.college,
                        "collegeName": this.queryForm.collegeName,
                        "projectId": this.queryForm.projectId,
                        "studentAwardsInfoList": studentAwardsInfoList
                    }
                    competiManagementApi.awardInfoAdd(param).then(res => {
                        if(res.code === 200) {
                            this.$message.success(this.$t('internship.successfully'))
                            this.$emit('change-exam')
                        }
                    })
                }
            })
        }
    },
}
</script>

<style></style>

